#define TIMER_PERIOD_MS 10 
#define ID_INPUT_TIMEOUT_SECONDS 10
#define ID_INPUT_TIMEOUT_TICKS (ID_INPUT_TIMEOUT_SECONDS*1000/TIMER_PERIOD_MS)

#define NB_TIMERS 5
extern uint16_t timer[NB_TIMERS];
#define TIMER_ANTIBOUNCING timer[0]
#define TIMER_TEMPERATURE_CAPTURE timer[1]
#define TIMER_AWAKE_INTERVAL timer[2]
#define TIMER_ACTION timer[3]
#define TIMER_TEST timer[4]

#define CLOCK_GAP_PA1_MAX 170 
#define CLOCK_GAP_PA2_MAX 60
#define SECURITY_MARGIN 20
#define SLOT_PERIOD 29
#define ANTIBOUNCING_DURATION 10
#define temperature_capture_timeout 1000
#define snd_rcv_timeout 1000             
#define preambule_timeout 24 
#define ack_data_timeout 400
#define awoken_timeout 50 
#define scan_timeout 900 

extern int backoff_timeout;  

void timer_tick_cb();
int timer_reached(uint16_t timer, uint16_t count);
int timer_not_reached(uint16_t timer, uint16_t count);